package com.ght.springboot.rabbitmq.customer;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @description: 测试
 * @author: haitao.gao
 * @create: 2019-01-09 17:39
 **/
@Component
public class TestQueueCustomer extends BaseQueueCustomer{


    public TestQueueCustomer(@Qualifier("queue1") Queue queue) {
        super(queue);
    }

    @Override
    public void onMessage(Message message, Channel channel) throws Exception {

        try {
            System.out.print("\n"+"测试消息队列：" + new String(message.getBody()) +"\n");
//            super.onMessage(message,channel);

        }catch (Exception e){

        }
    }
}
